<script setup lang="ts">
    import {ref,reactive} from 'vue'
    //子组件的数据=>传给父组件
    let cat = ref('奖状')

    let money = ref(100)

    //接受父组件传过来的数据
    defineProps(['dogData','ageData'])

    //本来是没有sendFather名的事件,需要在此处自定义
    const emits = defineEmits(['send-father'])

</script>
<template>
    <h3>Custom-emits-子组件</h3>
    <h4>父给子的狗的小名是:{{dogData}},年龄是:{{ageData}}</h4>
    <button @click="emits('send-father',cat)">子传父</button>
    <!-- $event就是代表事件的数据  -->
    <button @click="emits('send-father',cat,$event)">子传父-$event</button>

    <button @click="emits('send-father',cat,money)">子传父-多个值</button>
</template>
<style scoped>
   
</style>